#pragma once
// MESSAGE UAV_ATTACK_STATUS_TOAI PACKING

#define MAVLINK_MSG_ID_UAV_ATTACK_STATUS_TOAI 9


typedef struct __mavlink_uav_attack_status_toai_t {
 uint64_t time_unix_usec; /*< [us] Timestamp (UNIX epoch time).*/
 float rcv11; /*<  Reserved field 11 (altitude meters).*/
 float rcv12; /*<  Reserved field 12 (ground speed m/s).*/
 float rcv13; /*<  Reserved field 13 (vertical speed m/s).*/
 uint16_t frame_id; /*<  Frame ID (incremental counter for packet loss detection).*/
 int16_t body_roll_cd; /*< [cdeg] Body roll angle (deg*100, -18000~18000).*/
 int16_t body_pitch_cd; /*< [cdeg] Body pitch angle (deg*100, -18000~18000).*/
 int16_t body_yaw_cd; /*< [cdeg] Body yaw angle (deg*100, -18000~18000).*/
 int16_t body_rollrate_cd; /*< [cdeg/s] Body roll rate (deg/s*100, -30000~30000).*/
 int16_t body_pitchrate_cd; /*< [cdeg/s] Body pitch rate (deg/s*100, -30000~30000).*/
 int16_t body_yawrate_cd; /*< [cdeg/s] Body yaw rate (deg/s*100, -30000~30000).*/
 int16_t rcv7; /*<  Reserved field 7 (battery remaining percent).*/
 int16_t rcv8; /*<  Reserved field 8 (motor throttle).*/
 int16_t rcv9; /*<  Reserved field 9 (rangefinder distance cm).*/
 int16_t rcv10; /*<  Reserved field 10 (RC signal strength).*/
 uint8_t status1; /*<  Flight status 1 (attack step status).*/
 uint8_t status2; /*<  Flight status 2 (loiter state).*/
 uint8_t status3; /*<  Flight status 3 (error code).*/
} mavlink_uav_attack_status_toai_t;

#define MAVLINK_MSG_ID_UAV_ATTACK_STATUS_TOAI_LEN 45
#define MAVLINK_MSG_ID_UAV_ATTACK_STATUS_TOAI_MIN_LEN 45
#define MAVLINK_MSG_ID_9_LEN 45
#define MAVLINK_MSG_ID_9_MIN_LEN 45

#define MAVLINK_MSG_ID_UAV_ATTACK_STATUS_TOAI_CRC 200
#define MAVLINK_MSG_ID_9_CRC 200



#if MAVLINK_COMMAND_24BIT
#define MAVLINK_MESSAGE_INFO_UAV_ATTACK_STATUS_TOAI { \
    9, \
    "UAV_ATTACK_STATUS_TOAI", \
    18, \
    {  { "time_unix_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_uav_attack_status_toai_t, time_unix_usec) }, \
         { "frame_id", NULL, MAVLINK_TYPE_UINT16_T, 0, 20, offsetof(mavlink_uav_attack_status_toai_t, frame_id) }, \
         { "status1", NULL, MAVLINK_TYPE_UINT8_T, 0, 42, offsetof(mavlink_uav_attack_status_toai_t, status1) }, \
         { "status2", NULL, MAVLINK_TYPE_UINT8_T, 0, 43, offsetof(mavlink_uav_attack_status_toai_t, status2) }, \
         { "status3", NULL, MAVLINK_TYPE_UINT8_T, 0, 44, offsetof(mavlink_uav_attack_status_toai_t, status3) }, \
         { "body_roll_cd", NULL, MAVLINK_TYPE_INT16_T, 0, 22, offsetof(mavlink_uav_attack_status_toai_t, body_roll_cd) }, \
         { "body_pitch_cd", NULL, MAVLINK_TYPE_INT16_T, 0, 24, offsetof(mavlink_uav_attack_status_toai_t, body_pitch_cd) }, \
         { "body_yaw_cd", NULL, MAVLINK_TYPE_INT16_T, 0, 26, offsetof(mavlink_uav_attack_status_toai_t, body_yaw_cd) }, \
         { "body_rollrate_cd", NULL, MAVLINK_TYPE_INT16_T, 0, 28, offsetof(mavlink_uav_attack_status_toai_t, body_rollrate_cd) }, \
         { "body_pitchrate_cd", NULL, MAVLINK_TYPE_INT16_T, 0, 30, offsetof(mavlink_uav_attack_status_toai_t, body_pitchrate_cd) }, \
         { "body_yawrate_cd", NULL, MAVLINK_TYPE_INT16_T, 0, 32, offsetof(mavlink_uav_attack_status_toai_t, body_yawrate_cd) }, \
         { "rcv7", NULL, MAVLINK_TYPE_INT16_T, 0, 34, offsetof(mavlink_uav_attack_status_toai_t, rcv7) }, \
         { "rcv8", NULL, MAVLINK_TYPE_INT16_T, 0, 36, offsetof(mavlink_uav_attack_status_toai_t, rcv8) }, \
         { "rcv9", NULL, MAVLINK_TYPE_INT16_T, 0, 38, offsetof(mavlink_uav_attack_status_toai_t, rcv9) }, \
         { "rcv10", NULL, MAVLINK_TYPE_INT16_T, 0, 40, offsetof(mavlink_uav_attack_status_toai_t, rcv10) }, \
         { "rcv11", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_uav_attack_status_toai_t, rcv11) }, \
         { "rcv12", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_uav_attack_status_toai_t, rcv12) }, \
         { "rcv13", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_uav_attack_status_toai_t, rcv13) }, \
         } \
}
#else
#define MAVLINK_MESSAGE_INFO_UAV_ATTACK_STATUS_TOAI { \
    "UAV_ATTACK_STATUS_TOAI", \
    18, \
    {  { "time_unix_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_uav_attack_status_toai_t, time_unix_usec) }, \
         { "frame_id", NULL, MAVLINK_TYPE_UINT16_T, 0, 20, offsetof(mavlink_uav_attack_status_toai_t, frame_id) }, \
         { "status1", NULL, MAVLINK_TYPE_UINT8_T, 0, 42, offsetof(mavlink_uav_attack_status_toai_t, status1) }, \
         { "status2", NULL, MAVLINK_TYPE_UINT8_T, 0, 43, offsetof(mavlink_uav_attack_status_toai_t, status2) }, \
         { "status3", NULL, MAVLINK_TYPE_UINT8_T, 0, 44, offsetof(mavlink_uav_attack_status_toai_t, status3) }, \
         { "body_roll_cd", NULL, MAVLINK_TYPE_INT16_T, 0, 22, offsetof(mavlink_uav_attack_status_toai_t, body_roll_cd) }, \
         { "body_pitch_cd", NULL, MAVLINK_TYPE_INT16_T, 0, 24, offsetof(mavlink_uav_attack_status_toai_t, body_pitch_cd) }, \
         { "body_yaw_cd", NULL, MAVLINK_TYPE_INT16_T, 0, 26, offsetof(mavlink_uav_attack_status_toai_t, body_yaw_cd) }, \
         { "body_rollrate_cd", NULL, MAVLINK_TYPE_INT16_T, 0, 28, offsetof(mavlink_uav_attack_status_toai_t, body_rollrate_cd) }, \
         { "body_pitchrate_cd", NULL, MAVLINK_TYPE_INT16_T, 0, 30, offsetof(mavlink_uav_attack_status_toai_t, body_pitchrate_cd) }, \
         { "body_yawrate_cd", NULL, MAVLINK_TYPE_INT16_T, 0, 32, offsetof(mavlink_uav_attack_status_toai_t, body_yawrate_cd) }, \
         { "rcv7", NULL, MAVLINK_TYPE_INT16_T, 0, 34, offsetof(mavlink_uav_attack_status_toai_t, rcv7) }, \
         { "rcv8", NULL, MAVLINK_TYPE_INT16_T, 0, 36, offsetof(mavlink_uav_attack_status_toai_t, rcv8) }, \
         { "rcv9", NULL, MAVLINK_TYPE_INT16_T, 0, 38, offsetof(mavlink_uav_attack_status_toai_t, rcv9) }, \
         { "rcv10", NULL, MAVLINK_TYPE_INT16_T, 0, 40, offsetof(mavlink_uav_attack_status_toai_t, rcv10) }, \
         { "rcv11", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_uav_attack_status_toai_t, rcv11) }, \
         { "rcv12", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_uav_attack_status_toai_t, rcv12) }, \
         { "rcv13", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_uav_attack_status_toai_t, rcv13) }, \
         } \
}
#endif

/**
 * @brief Pack a uav_attack_status_toai message
 * @param system_id ID of this system
 * @param component_id ID of this component (e.g. 200 for IMU)
 * @param msg The MAVLink message to compress the data into
 *
 * @param time_unix_usec [us] Timestamp (UNIX epoch time).
 * @param frame_id  Frame ID (incremental counter for packet loss detection).
 * @param status1  Flight status 1 (attack step status).
 * @param status2  Flight status 2 (loiter state).
 * @param status3  Flight status 3 (error code).
 * @param body_roll_cd [cdeg] Body roll angle (deg*100, -18000~18000).
 * @param body_pitch_cd [cdeg] Body pitch angle (deg*100, -18000~18000).
 * @param body_yaw_cd [cdeg] Body yaw angle (deg*100, -18000~18000).
 * @param body_rollrate_cd [cdeg/s] Body roll rate (deg/s*100, -30000~30000).
 * @param body_pitchrate_cd [cdeg/s] Body pitch rate (deg/s*100, -30000~30000).
 * @param body_yawrate_cd [cdeg/s] Body yaw rate (deg/s*100, -30000~30000).
 * @param rcv7  Reserved field 7 (battery remaining percent).
 * @param rcv8  Reserved field 8 (motor throttle).
 * @param rcv9  Reserved field 9 (rangefinder distance cm).
 * @param rcv10  Reserved field 10 (RC signal strength).
 * @param rcv11  Reserved field 11 (altitude meters).
 * @param rcv12  Reserved field 12 (ground speed m/s).
 * @param rcv13  Reserved field 13 (vertical speed m/s).
 * @return length of the message in bytes (excluding serial stream start sign)
 */
static inline uint16_t mavlink_msg_uav_attack_status_toai_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
                               uint64_t time_unix_usec, uint16_t frame_id, uint8_t status1, uint8_t status2, uint8_t status3, int16_t body_roll_cd, int16_t body_pitch_cd, int16_t body_yaw_cd, int16_t body_rollrate_cd, int16_t body_pitchrate_cd, int16_t body_yawrate_cd, int16_t rcv7, int16_t rcv8, int16_t rcv9, int16_t rcv10, float rcv11, float rcv12, float rcv13)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
    char buf[MAVLINK_MSG_ID_UAV_ATTACK_STATUS_TOAI_LEN];
    _mav_put_uint64_t(buf, 0, time_unix_usec);
    _mav_put_float(buf, 8, rcv11);
    _mav_put_float(buf, 12, rcv12);
    _mav_put_float(buf, 16, rcv13);
    _mav_put_uint16_t(buf, 20, frame_id);
    _mav_put_int16_t(buf, 22, body_roll_cd);
    _mav_put_int16_t(buf, 24, body_pitch_cd);
    _mav_put_int16_t(buf, 26, body_yaw_cd);
    _mav_put_int16_t(buf, 28, body_rollrate_cd);
    _mav_put_int16_t(buf, 30, body_pitchrate_cd);
    _mav_put_int16_t(buf, 32, body_yawrate_cd);
    _mav_put_int16_t(buf, 34, rcv7);
    _mav_put_int16_t(buf, 36, rcv8);
    _mav_put_int16_t(buf, 38, rcv9);
    _mav_put_int16_t(buf, 40, rcv10);
    _mav_put_uint8_t(buf, 42, status1);
    _mav_put_uint8_t(buf, 43, status2);
    _mav_put_uint8_t(buf, 44, status3);

        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_UAV_ATTACK_STATUS_TOAI_LEN);
#else
    mavlink_uav_attack_status_toai_t packet;
    packet.time_unix_usec = time_unix_usec;
    packet.rcv11 = rcv11;
    packet.rcv12 = rcv12;
    packet.rcv13 = rcv13;
    packet.frame_id = frame_id;
    packet.body_roll_cd = body_roll_cd;
    packet.body_pitch_cd = body_pitch_cd;
    packet.body_yaw_cd = body_yaw_cd;
    packet.body_rollrate_cd = body_rollrate_cd;
    packet.body_pitchrate_cd = body_pitchrate_cd;
    packet.body_yawrate_cd = body_yawrate_cd;
    packet.rcv7 = rcv7;
    packet.rcv8 = rcv8;
    packet.rcv9 = rcv9;
    packet.rcv10 = rcv10;
    packet.status1 = status1;
    packet.status2 = status2;
    packet.status3 = status3;

        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_UAV_ATTACK_STATUS_TOAI_LEN);
#endif

    msg->msgid = MAVLINK_MSG_ID_UAV_ATTACK_STATUS_TOAI;
    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_UAV_ATTACK_STATUS_TOAI_MIN_LEN, MAVLINK_MSG_ID_UAV_ATTACK_STATUS_TOAI_LEN, MAVLINK_MSG_ID_UAV_ATTACK_STATUS_TOAI_CRC);
}

/**
 * @brief Pack a uav_attack_status_toai message
 * @param system_id ID of this system
 * @param component_id ID of this component (e.g. 200 for IMU)
 * @param status MAVLink status structure
 * @param msg The MAVLink message to compress the data into
 *
 * @param time_unix_usec [us] Timestamp (UNIX epoch time).
 * @param frame_id  Frame ID (incremental counter for packet loss detection).
 * @param status1  Flight status 1 (attack step status).
 * @param status2  Flight status 2 (loiter state).
 * @param status3  Flight status 3 (error code).
 * @param body_roll_cd [cdeg] Body roll angle (deg*100, -18000~18000).
 * @param body_pitch_cd [cdeg] Body pitch angle (deg*100, -18000~18000).
 * @param body_yaw_cd [cdeg] Body yaw angle (deg*100, -18000~18000).
 * @param body_rollrate_cd [cdeg/s] Body roll rate (deg/s*100, -30000~30000).
 * @param body_pitchrate_cd [cdeg/s] Body pitch rate (deg/s*100, -30000~30000).
 * @param body_yawrate_cd [cdeg/s] Body yaw rate (deg/s*100, -30000~30000).
 * @param rcv7  Reserved field 7 (battery remaining percent).
 * @param rcv8  Reserved field 8 (motor throttle).
 * @param rcv9  Reserved field 9 (rangefinder distance cm).
 * @param rcv10  Reserved field 10 (RC signal strength).
 * @param rcv11  Reserved field 11 (altitude meters).
 * @param rcv12  Reserved field 12 (ground speed m/s).
 * @param rcv13  Reserved field 13 (vertical speed m/s).
 * @return length of the message in bytes (excluding serial stream start sign)
 */
static inline uint16_t mavlink_msg_uav_attack_status_toai_pack_status(uint8_t system_id, uint8_t component_id, mavlink_status_t *_status, mavlink_message_t* msg,
                               uint64_t time_unix_usec, uint16_t frame_id, uint8_t status1, uint8_t status2, uint8_t status3, int16_t body_roll_cd, int16_t body_pitch_cd, int16_t body_yaw_cd, int16_t body_rollrate_cd, int16_t body_pitchrate_cd, int16_t body_yawrate_cd, int16_t rcv7, int16_t rcv8, int16_t rcv9, int16_t rcv10, float rcv11, float rcv12, float rcv13)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
    char buf[MAVLINK_MSG_ID_UAV_ATTACK_STATUS_TOAI_LEN];
    _mav_put_uint64_t(buf, 0, time_unix_usec);
    _mav_put_float(buf, 8, rcv11);
    _mav_put_float(buf, 12, rcv12);
    _mav_put_float(buf, 16, rcv13);
    _mav_put_uint16_t(buf, 20, frame_id);
    _mav_put_int16_t(buf, 22, body_roll_cd);
    _mav_put_int16_t(buf, 24, body_pitch_cd);
    _mav_put_int16_t(buf, 26, body_yaw_cd);
    _mav_put_int16_t(buf, 28, body_rollrate_cd);
    _mav_put_int16_t(buf, 30, body_pitchrate_cd);
    _mav_put_int16_t(buf, 32, body_yawrate_cd);
    _mav_put_int16_t(buf, 34, rcv7);
    _mav_put_int16_t(buf, 36, rcv8);
    _mav_put_int16_t(buf, 38, rcv9);
    _mav_put_int16_t(buf, 40, rcv10);
    _mav_put_uint8_t(buf, 42, status1);
    _mav_put_uint8_t(buf, 43, status2);
    _mav_put_uint8_t(buf, 44, status3);

        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_UAV_ATTACK_STATUS_TOAI_LEN);
#else
    mavlink_uav_attack_status_toai_t packet;
    packet.time_unix_usec = time_unix_usec;
    packet.rcv11 = rcv11;
    packet.rcv12 = rcv12;
    packet.rcv13 = rcv13;
    packet.frame_id = frame_id;
    packet.body_roll_cd = body_roll_cd;
    packet.body_pitch_cd = body_pitch_cd;
    packet.body_yaw_cd = body_yaw_cd;
    packet.body_rollrate_cd = body_rollrate_cd;
    packet.body_pitchrate_cd = body_pitchrate_cd;
    packet.body_yawrate_cd = body_yawrate_cd;
    packet.rcv7 = rcv7;
    packet.rcv8 = rcv8;
    packet.rcv9 = rcv9;
    packet.rcv10 = rcv10;
    packet.status1 = status1;
    packet.status2 = status2;
    packet.status3 = status3;

        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_UAV_ATTACK_STATUS_TOAI_LEN);
#endif

    msg->msgid = MAVLINK_MSG_ID_UAV_ATTACK_STATUS_TOAI;
#if MAVLINK_CRC_EXTRA
    return mavlink_finalize_message_buffer(msg, system_id, component_id, _status, MAVLINK_MSG_ID_UAV_ATTACK_STATUS_TOAI_MIN_LEN, MAVLINK_MSG_ID_UAV_ATTACK_STATUS_TOAI_LEN, MAVLINK_MSG_ID_UAV_ATTACK_STATUS_TOAI_CRC);
#else
    return mavlink_finalize_message_buffer(msg, system_id, component_id, _status, MAVLINK_MSG_ID_UAV_ATTACK_STATUS_TOAI_MIN_LEN, MAVLINK_MSG_ID_UAV_ATTACK_STATUS_TOAI_LEN);
#endif
}

/**
 * @brief Pack a uav_attack_status_toai message on a channel
 * @param system_id ID of this system
 * @param component_id ID of this component (e.g. 200 for IMU)
 * @param chan The MAVLink channel this message will be sent over
 * @param msg The MAVLink message to compress the data into
 * @param time_unix_usec [us] Timestamp (UNIX epoch time).
 * @param frame_id  Frame ID (incremental counter for packet loss detection).
 * @param status1  Flight status 1 (attack step status).
 * @param status2  Flight status 2 (loiter state).
 * @param status3  Flight status 3 (error code).
 * @param body_roll_cd [cdeg] Body roll angle (deg*100, -18000~18000).
 * @param body_pitch_cd [cdeg] Body pitch angle (deg*100, -18000~18000).
 * @param body_yaw_cd [cdeg] Body yaw angle (deg*100, -18000~18000).
 * @param body_rollrate_cd [cdeg/s] Body roll rate (deg/s*100, -30000~30000).
 * @param body_pitchrate_cd [cdeg/s] Body pitch rate (deg/s*100, -30000~30000).
 * @param body_yawrate_cd [cdeg/s] Body yaw rate (deg/s*100, -30000~30000).
 * @param rcv7  Reserved field 7 (battery remaining percent).
 * @param rcv8  Reserved field 8 (motor throttle).
 * @param rcv9  Reserved field 9 (rangefinder distance cm).
 * @param rcv10  Reserved field 10 (RC signal strength).
 * @param rcv11  Reserved field 11 (altitude meters).
 * @param rcv12  Reserved field 12 (ground speed m/s).
 * @param rcv13  Reserved field 13 (vertical speed m/s).
 * @return length of the message in bytes (excluding serial stream start sign)
 */
static inline uint16_t mavlink_msg_uav_attack_status_toai_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
                               mavlink_message_t* msg,
                                   uint64_t time_unix_usec,uint16_t frame_id,uint8_t status1,uint8_t status2,uint8_t status3,int16_t body_roll_cd,int16_t body_pitch_cd,int16_t body_yaw_cd,int16_t body_rollrate_cd,int16_t body_pitchrate_cd,int16_t body_yawrate_cd,int16_t rcv7,int16_t rcv8,int16_t rcv9,int16_t rcv10,float rcv11,float rcv12,float rcv13)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
    char buf[MAVLINK_MSG_ID_UAV_ATTACK_STATUS_TOAI_LEN];
    _mav_put_uint64_t(buf, 0, time_unix_usec);
    _mav_put_float(buf, 8, rcv11);
    _mav_put_float(buf, 12, rcv12);
    _mav_put_float(buf, 16, rcv13);
    _mav_put_uint16_t(buf, 20, frame_id);
    _mav_put_int16_t(buf, 22, body_roll_cd);
    _mav_put_int16_t(buf, 24, body_pitch_cd);
    _mav_put_int16_t(buf, 26, body_yaw_cd);
    _mav_put_int16_t(buf, 28, body_rollrate_cd);
    _mav_put_int16_t(buf, 30, body_pitchrate_cd);
    _mav_put_int16_t(buf, 32, body_yawrate_cd);
    _mav_put_int16_t(buf, 34, rcv7);
    _mav_put_int16_t(buf, 36, rcv8);
    _mav_put_int16_t(buf, 38, rcv9);
    _mav_put_int16_t(buf, 40, rcv10);
    _mav_put_uint8_t(buf, 42, status1);
    _mav_put_uint8_t(buf, 43, status2);
    _mav_put_uint8_t(buf, 44, status3);

        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_UAV_ATTACK_STATUS_TOAI_LEN);
#else
    mavlink_uav_attack_status_toai_t packet;
    packet.time_unix_usec = time_unix_usec;
    packet.rcv11 = rcv11;
    packet.rcv12 = rcv12;
    packet.rcv13 = rcv13;
    packet.frame_id = frame_id;
    packet.body_roll_cd = body_roll_cd;
    packet.body_pitch_cd = body_pitch_cd;
    packet.body_yaw_cd = body_yaw_cd;
    packet.body_rollrate_cd = body_rollrate_cd;
    packet.body_pitchrate_cd = body_pitchrate_cd;
    packet.body_yawrate_cd = body_yawrate_cd;
    packet.rcv7 = rcv7;
    packet.rcv8 = rcv8;
    packet.rcv9 = rcv9;
    packet.rcv10 = rcv10;
    packet.status1 = status1;
    packet.status2 = status2;
    packet.status3 = status3;

        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_UAV_ATTACK_STATUS_TOAI_LEN);
#endif

    msg->msgid = MAVLINK_MSG_ID_UAV_ATTACK_STATUS_TOAI;
    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_UAV_ATTACK_STATUS_TOAI_MIN_LEN, MAVLINK_MSG_ID_UAV_ATTACK_STATUS_TOAI_LEN, MAVLINK_MSG_ID_UAV_ATTACK_STATUS_TOAI_CRC);
}

/**
 * @brief Encode a uav_attack_status_toai struct
 *
 * @param system_id ID of this system
 * @param component_id ID of this component (e.g. 200 for IMU)
 * @param msg The MAVLink message to compress the data into
 * @param uav_attack_status_toai C-struct to read the message contents from
 */
static inline uint16_t mavlink_msg_uav_attack_status_toai_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_uav_attack_status_toai_t* uav_attack_status_toai)
{
    return mavlink_msg_uav_attack_status_toai_pack(system_id, component_id, msg, uav_attack_status_toai->time_unix_usec, uav_attack_status_toai->frame_id, uav_attack_status_toai->status1, uav_attack_status_toai->status2, uav_attack_status_toai->status3, uav_attack_status_toai->body_roll_cd, uav_attack_status_toai->body_pitch_cd, uav_attack_status_toai->body_yaw_cd, uav_attack_status_toai->body_rollrate_cd, uav_attack_status_toai->body_pitchrate_cd, uav_attack_status_toai->body_yawrate_cd, uav_attack_status_toai->rcv7, uav_attack_status_toai->rcv8, uav_attack_status_toai->rcv9, uav_attack_status_toai->rcv10, uav_attack_status_toai->rcv11, uav_attack_status_toai->rcv12, uav_attack_status_toai->rcv13);
}

/**
 * @brief Encode a uav_attack_status_toai struct on a channel
 *
 * @param system_id ID of this system
 * @param component_id ID of this component (e.g. 200 for IMU)
 * @param chan The MAVLink channel this message will be sent over
 * @param msg The MAVLink message to compress the data into
 * @param uav_attack_status_toai C-struct to read the message contents from
 */
static inline uint16_t mavlink_msg_uav_attack_status_toai_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_uav_attack_status_toai_t* uav_attack_status_toai)
{
    return mavlink_msg_uav_attack_status_toai_pack_chan(system_id, component_id, chan, msg, uav_attack_status_toai->time_unix_usec, uav_attack_status_toai->frame_id, uav_attack_status_toai->status1, uav_attack_status_toai->status2, uav_attack_status_toai->status3, uav_attack_status_toai->body_roll_cd, uav_attack_status_toai->body_pitch_cd, uav_attack_status_toai->body_yaw_cd, uav_attack_status_toai->body_rollrate_cd, uav_attack_status_toai->body_pitchrate_cd, uav_attack_status_toai->body_yawrate_cd, uav_attack_status_toai->rcv7, uav_attack_status_toai->rcv8, uav_attack_status_toai->rcv9, uav_attack_status_toai->rcv10, uav_attack_status_toai->rcv11, uav_attack_status_toai->rcv12, uav_attack_status_toai->rcv13);
}

/**
 * @brief Encode a uav_attack_status_toai struct with provided status structure
 *
 * @param system_id ID of this system
 * @param component_id ID of this component (e.g. 200 for IMU)
 * @param status MAVLink status structure
 * @param msg The MAVLink message to compress the data into
 * @param uav_attack_status_toai C-struct to read the message contents from
 */
static inline uint16_t mavlink_msg_uav_attack_status_toai_encode_status(uint8_t system_id, uint8_t component_id, mavlink_status_t* _status, mavlink_message_t* msg, const mavlink_uav_attack_status_toai_t* uav_attack_status_toai)
{
    return mavlink_msg_uav_attack_status_toai_pack_status(system_id, component_id, _status, msg,  uav_attack_status_toai->time_unix_usec, uav_attack_status_toai->frame_id, uav_attack_status_toai->status1, uav_attack_status_toai->status2, uav_attack_status_toai->status3, uav_attack_status_toai->body_roll_cd, uav_attack_status_toai->body_pitch_cd, uav_attack_status_toai->body_yaw_cd, uav_attack_status_toai->body_rollrate_cd, uav_attack_status_toai->body_pitchrate_cd, uav_attack_status_toai->body_yawrate_cd, uav_attack_status_toai->rcv7, uav_attack_status_toai->rcv8, uav_attack_status_toai->rcv9, uav_attack_status_toai->rcv10, uav_attack_status_toai->rcv11, uav_attack_status_toai->rcv12, uav_attack_status_toai->rcv13);
}

/**
 * @brief Send a uav_attack_status_toai message
 * @param chan MAVLink channel to send the message
 *
 * @param time_unix_usec [us] Timestamp (UNIX epoch time).
 * @param frame_id  Frame ID (incremental counter for packet loss detection).
 * @param status1  Flight status 1 (attack step status).
 * @param status2  Flight status 2 (loiter state).
 * @param status3  Flight status 3 (error code).
 * @param body_roll_cd [cdeg] Body roll angle (deg*100, -18000~18000).
 * @param body_pitch_cd [cdeg] Body pitch angle (deg*100, -18000~18000).
 * @param body_yaw_cd [cdeg] Body yaw angle (deg*100, -18000~18000).
 * @param body_rollrate_cd [cdeg/s] Body roll rate (deg/s*100, -30000~30000).
 * @param body_pitchrate_cd [cdeg/s] Body pitch rate (deg/s*100, -30000~30000).
 * @param body_yawrate_cd [cdeg/s] Body yaw rate (deg/s*100, -30000~30000).
 * @param rcv7  Reserved field 7 (battery remaining percent).
 * @param rcv8  Reserved field 8 (motor throttle).
 * @param rcv9  Reserved field 9 (rangefinder distance cm).
 * @param rcv10  Reserved field 10 (RC signal strength).
 * @param rcv11  Reserved field 11 (altitude meters).
 * @param rcv12  Reserved field 12 (ground speed m/s).
 * @param rcv13  Reserved field 13 (vertical speed m/s).
 */
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS

static inline void mavlink_msg_uav_attack_status_toai_send(mavlink_channel_t chan, uint64_t time_unix_usec, uint16_t frame_id, uint8_t status1, uint8_t status2, uint8_t status3, int16_t body_roll_cd, int16_t body_pitch_cd, int16_t body_yaw_cd, int16_t body_rollrate_cd, int16_t body_pitchrate_cd, int16_t body_yawrate_cd, int16_t rcv7, int16_t rcv8, int16_t rcv9, int16_t rcv10, float rcv11, float rcv12, float rcv13)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
    char buf[MAVLINK_MSG_ID_UAV_ATTACK_STATUS_TOAI_LEN];
    _mav_put_uint64_t(buf, 0, time_unix_usec);
    _mav_put_float(buf, 8, rcv11);
    _mav_put_float(buf, 12, rcv12);
    _mav_put_float(buf, 16, rcv13);
    _mav_put_uint16_t(buf, 20, frame_id);
    _mav_put_int16_t(buf, 22, body_roll_cd);
    _mav_put_int16_t(buf, 24, body_pitch_cd);
    _mav_put_int16_t(buf, 26, body_yaw_cd);
    _mav_put_int16_t(buf, 28, body_rollrate_cd);
    _mav_put_int16_t(buf, 30, body_pitchrate_cd);
    _mav_put_int16_t(buf, 32, body_yawrate_cd);
    _mav_put_int16_t(buf, 34, rcv7);
    _mav_put_int16_t(buf, 36, rcv8);
    _mav_put_int16_t(buf, 38, rcv9);
    _mav_put_int16_t(buf, 40, rcv10);
    _mav_put_uint8_t(buf, 42, status1);
    _mav_put_uint8_t(buf, 43, status2);
    _mav_put_uint8_t(buf, 44, status3);

    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UAV_ATTACK_STATUS_TOAI, buf, MAVLINK_MSG_ID_UAV_ATTACK_STATUS_TOAI_MIN_LEN, MAVLINK_MSG_ID_UAV_ATTACK_STATUS_TOAI_LEN, MAVLINK_MSG_ID_UAV_ATTACK_STATUS_TOAI_CRC);
#else
    mavlink_uav_attack_status_toai_t packet;
    packet.time_unix_usec = time_unix_usec;
    packet.rcv11 = rcv11;
    packet.rcv12 = rcv12;
    packet.rcv13 = rcv13;
    packet.frame_id = frame_id;
    packet.body_roll_cd = body_roll_cd;
    packet.body_pitch_cd = body_pitch_cd;
    packet.body_yaw_cd = body_yaw_cd;
    packet.body_rollrate_cd = body_rollrate_cd;
    packet.body_pitchrate_cd = body_pitchrate_cd;
    packet.body_yawrate_cd = body_yawrate_cd;
    packet.rcv7 = rcv7;
    packet.rcv8 = rcv8;
    packet.rcv9 = rcv9;
    packet.rcv10 = rcv10;
    packet.status1 = status1;
    packet.status2 = status2;
    packet.status3 = status3;

    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UAV_ATTACK_STATUS_TOAI, (const char *)&packet, MAVLINK_MSG_ID_UAV_ATTACK_STATUS_TOAI_MIN_LEN, MAVLINK_MSG_ID_UAV_ATTACK_STATUS_TOAI_LEN, MAVLINK_MSG_ID_UAV_ATTACK_STATUS_TOAI_CRC);
#endif
}

/**
 * @brief Send a uav_attack_status_toai message
 * @param chan MAVLink channel to send the message
 * @param struct The MAVLink struct to serialize
 */
static inline void mavlink_msg_uav_attack_status_toai_send_struct(mavlink_channel_t chan, const mavlink_uav_attack_status_toai_t* uav_attack_status_toai)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
    mavlink_msg_uav_attack_status_toai_send(chan, uav_attack_status_toai->time_unix_usec, uav_attack_status_toai->frame_id, uav_attack_status_toai->status1, uav_attack_status_toai->status2, uav_attack_status_toai->status3, uav_attack_status_toai->body_roll_cd, uav_attack_status_toai->body_pitch_cd, uav_attack_status_toai->body_yaw_cd, uav_attack_status_toai->body_rollrate_cd, uav_attack_status_toai->body_pitchrate_cd, uav_attack_status_toai->body_yawrate_cd, uav_attack_status_toai->rcv7, uav_attack_status_toai->rcv8, uav_attack_status_toai->rcv9, uav_attack_status_toai->rcv10, uav_attack_status_toai->rcv11, uav_attack_status_toai->rcv12, uav_attack_status_toai->rcv13);
#else
    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UAV_ATTACK_STATUS_TOAI, (const char *)uav_attack_status_toai, MAVLINK_MSG_ID_UAV_ATTACK_STATUS_TOAI_MIN_LEN, MAVLINK_MSG_ID_UAV_ATTACK_STATUS_TOAI_LEN, MAVLINK_MSG_ID_UAV_ATTACK_STATUS_TOAI_CRC);
#endif
}

#if MAVLINK_MSG_ID_UAV_ATTACK_STATUS_TOAI_LEN <= MAVLINK_MAX_PAYLOAD_LEN
/*
  This variant of _send() can be used to save stack space by re-using
  memory from the receive buffer.  The caller provides a
  mavlink_message_t which is the size of a full mavlink message. This
  is usually the receive buffer for the channel, and allows a reply to an
  incoming message with minimum stack space usage.
 */
static inline void mavlink_msg_uav_attack_status_toai_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  uint64_t time_unix_usec, uint16_t frame_id, uint8_t status1, uint8_t status2, uint8_t status3, int16_t body_roll_cd, int16_t body_pitch_cd, int16_t body_yaw_cd, int16_t body_rollrate_cd, int16_t body_pitchrate_cd, int16_t body_yawrate_cd, int16_t rcv7, int16_t rcv8, int16_t rcv9, int16_t rcv10, float rcv11, float rcv12, float rcv13)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
    char *buf = (char *)msgbuf;
    _mav_put_uint64_t(buf, 0, time_unix_usec);
    _mav_put_float(buf, 8, rcv11);
    _mav_put_float(buf, 12, rcv12);
    _mav_put_float(buf, 16, rcv13);
    _mav_put_uint16_t(buf, 20, frame_id);
    _mav_put_int16_t(buf, 22, body_roll_cd);
    _mav_put_int16_t(buf, 24, body_pitch_cd);
    _mav_put_int16_t(buf, 26, body_yaw_cd);
    _mav_put_int16_t(buf, 28, body_rollrate_cd);
    _mav_put_int16_t(buf, 30, body_pitchrate_cd);
    _mav_put_int16_t(buf, 32, body_yawrate_cd);
    _mav_put_int16_t(buf, 34, rcv7);
    _mav_put_int16_t(buf, 36, rcv8);
    _mav_put_int16_t(buf, 38, rcv9);
    _mav_put_int16_t(buf, 40, rcv10);
    _mav_put_uint8_t(buf, 42, status1);
    _mav_put_uint8_t(buf, 43, status2);
    _mav_put_uint8_t(buf, 44, status3);

    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UAV_ATTACK_STATUS_TOAI, buf, MAVLINK_MSG_ID_UAV_ATTACK_STATUS_TOAI_MIN_LEN, MAVLINK_MSG_ID_UAV_ATTACK_STATUS_TOAI_LEN, MAVLINK_MSG_ID_UAV_ATTACK_STATUS_TOAI_CRC);
#else
    mavlink_uav_attack_status_toai_t *packet = (mavlink_uav_attack_status_toai_t *)msgbuf;
    packet->time_unix_usec = time_unix_usec;
    packet->rcv11 = rcv11;
    packet->rcv12 = rcv12;
    packet->rcv13 = rcv13;
    packet->frame_id = frame_id;
    packet->body_roll_cd = body_roll_cd;
    packet->body_pitch_cd = body_pitch_cd;
    packet->body_yaw_cd = body_yaw_cd;
    packet->body_rollrate_cd = body_rollrate_cd;
    packet->body_pitchrate_cd = body_pitchrate_cd;
    packet->body_yawrate_cd = body_yawrate_cd;
    packet->rcv7 = rcv7;
    packet->rcv8 = rcv8;
    packet->rcv9 = rcv9;
    packet->rcv10 = rcv10;
    packet->status1 = status1;
    packet->status2 = status2;
    packet->status3 = status3;

    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UAV_ATTACK_STATUS_TOAI, (const char *)packet, MAVLINK_MSG_ID_UAV_ATTACK_STATUS_TOAI_MIN_LEN, MAVLINK_MSG_ID_UAV_ATTACK_STATUS_TOAI_LEN, MAVLINK_MSG_ID_UAV_ATTACK_STATUS_TOAI_CRC);
#endif
}
#endif

#endif

// MESSAGE UAV_ATTACK_STATUS_TOAI UNPACKING


/**
 * @brief Get field time_unix_usec from uav_attack_status_toai message
 *
 * @return [us] Timestamp (UNIX epoch time).
 */
static inline uint64_t mavlink_msg_uav_attack_status_toai_get_time_unix_usec(const mavlink_message_t* msg)
{
    return _MAV_RETURN_uint64_t(msg,  0);
}

/**
 * @brief Get field frame_id from uav_attack_status_toai message
 *
 * @return  Frame ID (incremental counter for packet loss detection).
 */
static inline uint16_t mavlink_msg_uav_attack_status_toai_get_frame_id(const mavlink_message_t* msg)
{
    return _MAV_RETURN_uint16_t(msg,  20);
}

/**
 * @brief Get field status1 from uav_attack_status_toai message
 *
 * @return  Flight status 1 (attack step status).
 */
static inline uint8_t mavlink_msg_uav_attack_status_toai_get_status1(const mavlink_message_t* msg)
{
    return _MAV_RETURN_uint8_t(msg,  42);
}

/**
 * @brief Get field status2 from uav_attack_status_toai message
 *
 * @return  Flight status 2 (loiter state).
 */
static inline uint8_t mavlink_msg_uav_attack_status_toai_get_status2(const mavlink_message_t* msg)
{
    return _MAV_RETURN_uint8_t(msg,  43);
}

/**
 * @brief Get field status3 from uav_attack_status_toai message
 *
 * @return  Flight status 3 (error code).
 */
static inline uint8_t mavlink_msg_uav_attack_status_toai_get_status3(const mavlink_message_t* msg)
{
    return _MAV_RETURN_uint8_t(msg,  44);
}

/**
 * @brief Get field body_roll_cd from uav_attack_status_toai message
 *
 * @return [cdeg] Body roll angle (deg*100, -18000~18000).
 */
static inline int16_t mavlink_msg_uav_attack_status_toai_get_body_roll_cd(const mavlink_message_t* msg)
{
    return _MAV_RETURN_int16_t(msg,  22);
}

/**
 * @brief Get field body_pitch_cd from uav_attack_status_toai message
 *
 * @return [cdeg] Body pitch angle (deg*100, -18000~18000).
 */
static inline int16_t mavlink_msg_uav_attack_status_toai_get_body_pitch_cd(const mavlink_message_t* msg)
{
    return _MAV_RETURN_int16_t(msg,  24);
}

/**
 * @brief Get field body_yaw_cd from uav_attack_status_toai message
 *
 * @return [cdeg] Body yaw angle (deg*100, -18000~18000).
 */
static inline int16_t mavlink_msg_uav_attack_status_toai_get_body_yaw_cd(const mavlink_message_t* msg)
{
    return _MAV_RETURN_int16_t(msg,  26);
}

/**
 * @brief Get field body_rollrate_cd from uav_attack_status_toai message
 *
 * @return [cdeg/s] Body roll rate (deg/s*100, -30000~30000).
 */
static inline int16_t mavlink_msg_uav_attack_status_toai_get_body_rollrate_cd(const mavlink_message_t* msg)
{
    return _MAV_RETURN_int16_t(msg,  28);
}

/**
 * @brief Get field body_pitchrate_cd from uav_attack_status_toai message
 *
 * @return [cdeg/s] Body pitch rate (deg/s*100, -30000~30000).
 */
static inline int16_t mavlink_msg_uav_attack_status_toai_get_body_pitchrate_cd(const mavlink_message_t* msg)
{
    return _MAV_RETURN_int16_t(msg,  30);
}

/**
 * @brief Get field body_yawrate_cd from uav_attack_status_toai message
 *
 * @return [cdeg/s] Body yaw rate (deg/s*100, -30000~30000).
 */
static inline int16_t mavlink_msg_uav_attack_status_toai_get_body_yawrate_cd(const mavlink_message_t* msg)
{
    return _MAV_RETURN_int16_t(msg,  32);
}

/**
 * @brief Get field rcv7 from uav_attack_status_toai message
 *
 * @return  Reserved field 7 (battery remaining percent).
 */
static inline int16_t mavlink_msg_uav_attack_status_toai_get_rcv7(const mavlink_message_t* msg)
{
    return _MAV_RETURN_int16_t(msg,  34);
}

/**
 * @brief Get field rcv8 from uav_attack_status_toai message
 *
 * @return  Reserved field 8 (motor throttle).
 */
static inline int16_t mavlink_msg_uav_attack_status_toai_get_rcv8(const mavlink_message_t* msg)
{
    return _MAV_RETURN_int16_t(msg,  36);
}

/**
 * @brief Get field rcv9 from uav_attack_status_toai message
 *
 * @return  Reserved field 9 (rangefinder distance cm).
 */
static inline int16_t mavlink_msg_uav_attack_status_toai_get_rcv9(const mavlink_message_t* msg)
{
    return _MAV_RETURN_int16_t(msg,  38);
}

/**
 * @brief Get field rcv10 from uav_attack_status_toai message
 *
 * @return  Reserved field 10 (RC signal strength).
 */
static inline int16_t mavlink_msg_uav_attack_status_toai_get_rcv10(const mavlink_message_t* msg)
{
    return _MAV_RETURN_int16_t(msg,  40);
}

/**
 * @brief Get field rcv11 from uav_attack_status_toai message
 *
 * @return  Reserved field 11 (altitude meters).
 */
static inline float mavlink_msg_uav_attack_status_toai_get_rcv11(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  8);
}

/**
 * @brief Get field rcv12 from uav_attack_status_toai message
 *
 * @return  Reserved field 12 (ground speed m/s).
 */
static inline float mavlink_msg_uav_attack_status_toai_get_rcv12(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  12);
}

/**
 * @brief Get field rcv13 from uav_attack_status_toai message
 *
 * @return  Reserved field 13 (vertical speed m/s).
 */
static inline float mavlink_msg_uav_attack_status_toai_get_rcv13(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  16);
}

/**
 * @brief Decode a uav_attack_status_toai message into a struct
 *
 * @param msg The message to decode
 * @param uav_attack_status_toai C-struct to decode the message contents into
 */
static inline void mavlink_msg_uav_attack_status_toai_decode(const mavlink_message_t* msg, mavlink_uav_attack_status_toai_t* uav_attack_status_toai)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
    uav_attack_status_toai->time_unix_usec = mavlink_msg_uav_attack_status_toai_get_time_unix_usec(msg);
    uav_attack_status_toai->rcv11 = mavlink_msg_uav_attack_status_toai_get_rcv11(msg);
    uav_attack_status_toai->rcv12 = mavlink_msg_uav_attack_status_toai_get_rcv12(msg);
    uav_attack_status_toai->rcv13 = mavlink_msg_uav_attack_status_toai_get_rcv13(msg);
    uav_attack_status_toai->frame_id = mavlink_msg_uav_attack_status_toai_get_frame_id(msg);
    uav_attack_status_toai->body_roll_cd = mavlink_msg_uav_attack_status_toai_get_body_roll_cd(msg);
    uav_attack_status_toai->body_pitch_cd = mavlink_msg_uav_attack_status_toai_get_body_pitch_cd(msg);
    uav_attack_status_toai->body_yaw_cd = mavlink_msg_uav_attack_status_toai_get_body_yaw_cd(msg);
    uav_attack_status_toai->body_rollrate_cd = mavlink_msg_uav_attack_status_toai_get_body_rollrate_cd(msg);
    uav_attack_status_toai->body_pitchrate_cd = mavlink_msg_uav_attack_status_toai_get_body_pitchrate_cd(msg);
    uav_attack_status_toai->body_yawrate_cd = mavlink_msg_uav_attack_status_toai_get_body_yawrate_cd(msg);
    uav_attack_status_toai->rcv7 = mavlink_msg_uav_attack_status_toai_get_rcv7(msg);
    uav_attack_status_toai->rcv8 = mavlink_msg_uav_attack_status_toai_get_rcv8(msg);
    uav_attack_status_toai->rcv9 = mavlink_msg_uav_attack_status_toai_get_rcv9(msg);
    uav_attack_status_toai->rcv10 = mavlink_msg_uav_attack_status_toai_get_rcv10(msg);
    uav_attack_status_toai->status1 = mavlink_msg_uav_attack_status_toai_get_status1(msg);
    uav_attack_status_toai->status2 = mavlink_msg_uav_attack_status_toai_get_status2(msg);
    uav_attack_status_toai->status3 = mavlink_msg_uav_attack_status_toai_get_status3(msg);
#else
        uint8_t len = msg->len < MAVLINK_MSG_ID_UAV_ATTACK_STATUS_TOAI_LEN? msg->len : MAVLINK_MSG_ID_UAV_ATTACK_STATUS_TOAI_LEN;
        memset(uav_attack_status_toai, 0, MAVLINK_MSG_ID_UAV_ATTACK_STATUS_TOAI_LEN);
    memcpy(uav_attack_status_toai, _MAV_PAYLOAD(msg), len);
#endif
}
